#!/bin/bash
# $Id: list_network_connections.sh 75 2011-08-10 01:01:57Z m.shannaq@gmail.com $
# PPPLHE http://ppplhe.wikidot.com
# list_network_connections.sh: This tool get the number connections from the connected IPs. it used to detect simple DDoS attack.
# Tool Page: http://ppplhe.wikidot.com/list-network-connections-sh
# Scriptter: Mohammed Shannaq, http://shannaq.com
# This is OpenSource File, Feel Free
# Useage: sh list_network_connections.sh  

netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n